Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36d4ff286a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
AI comment: This removes the agent-owned config path, so If ACP should always use process-global config, should we remove |
Replace all Config::new(config_dir.join(...), "goose") calls in the SACP server with Config::global(), which uses the same default path but goes through the shared singleton mutex. This: - Serializes all config read-modify-write operations (same protection as Goose 1's REST server) - Fixes a keyring bug where Config::new() hardcoded SecretStorage::Keyring and ignored the GOOSE_DISABLE_KEYRING env var - Eliminates inconsistency where some handlers already used Config::global() while config CRUD handlers used the per-instance Config::new() path - Removes the now-unnecessary config_dir field, load_config/config methods, and CONFIG_YAML_NAME import from the SACP server Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…CP server Remove the unnecessary bare block around Config::global() usage in resolve_provider_and_model_with_inventory_refresh. Since Config::global() returns &'static Config and cannot fail, the extra block scope (left over from the old fallible Config::new() error-handling pattern) serves no purpose. Removing it flattens indentation by one level. Also fix three clippy::needless_borrow warnings where &config was passed but config is already &'static Config, so the extra reference is immediately dereferenced by the compiler. Signed-off-by: Matt Toohey <contact@matttoohey.com>
Add Config::init_global(config_dir) that initializes the global singleton with a caller-provided config directory instead of the default. This addresses PR feedback that Config::global() silently ignored the config_dir field from AcpServerFactoryConfig. The server factory now calls init_global(config_dir) so that if a non-default config directory is ever passed, the global Config will use the correct path while still providing the singleton mutex serialization benefit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build Config::init_global from the same config path stack as Config::default and return an error when an existing global config points at a different writable path. Validate that invariant from GooseAcpAgent::new so direct ACP callers cannot silently use a stale global config. Update ACP fixtures to use one process-global test config directory and add a regression test for mismatched config directories. Signed-off-by: Matt Toohey <contact@matttoohey.com>
70382ad to
66b8f26
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66b8f26323
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Add Config::for_config_dir with a path-normalized cache so custom ACP config directories share one Config mutex and secrets cache without forcing them through the global singleton. Keep the default config path on Config::global(). Store the selected config handle on GooseAcpAgent and use it for the ACP paths that previously built a per-request Config, including session provider/model resolution and generic config/secret custom requests. Update ACP fixtures and regression coverage for default/global handling, custom-directory coexistence, equivalent path normalization, shared state, and concurrent config upserts. Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36d2e72982
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let config = Arc::new(Self::new(config_path, KEYRING_SERVICE)?); | ||
| cache.insert(cache_key, Arc::clone(&config)); |
There was a problem hiding this comment.
Recreate cached Config when keyring mode changes
Config::for_config_dir now caches a single Config instance per path, but Config::new decides SecretStorage once from GOOSE_DISABLE_KEYRING/config at construction time. After an ACP client updates GOOSE_DISABLE_KEYRING via _goose/config/upsert, later secret RPCs keep using the old backend (keyring vs secrets.yaml) until restart, whereas the previous per-call Config::new(...) path re-evaluated this setting each request. This can make secret reads/writes fail or go to the wrong store immediately after a runtime toggle.
Useful? React with 👍 / 👎.
🤖 Updated by AI agent.
This fixes ACP config races by sharing a
Confighandle for each config path instead of creating a new config object per request. The default Goose config directory still usesConfig::global(), while custom ACP config directories use a process-wide cache keyed by the normalizedconfig.yamlpath.Summary
Config::for_config_dir(...)andConfigHandleto select either the default global config or a cached custom-path config.GooseAcpAgentand reuse it for session setup, provider/model resolution, config CRUD, and secret requests.AcpServercreation to read Goose mode from the same path-aware config handle.Tests